/*
 * Copyright 2008 Lucifer Lu
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

using System;
using System.Collections.Generic;

namespace SilverChart.Core.Log {
    /// <summary>
    /// Description of AbstractLoggerConfigurations.
    /// </summary>
    public class LoggerConfigurations {
        public LoggerConfigurations() {
            Loggers = new List<String>();
            DebugFormat = _DefaultDebugMessageFormat;
            InfoFormat = _DefaultInfoMessageFormat;
            WarnFormat = _DefaultWarnMessageFormat;
            ErrorFormat = _DefaultErrorMessageFormat;
            FatalFormat = _DefaultFatalMessageFormat;
            CreateLogDiv = false;
            GlobalLogLevel = LogLevel.Warn;
        }

        public virtual List<String> Loggers { get; set; }
        public virtual String DebugFormat { get; set; }
        public virtual String InfoFormat { get; set; }
        public virtual String WarnFormat { get; set; }
        public virtual String ErrorFormat { get; set; }
        public virtual String FatalFormat { get; set; }
        public virtual Boolean CreateLogDiv { get; set; }
        public virtual String DivName { get; set; }
        public virtual LogLevel GlobalLogLevel { get; set; }

        //{0}:Priority
        //{1}:Message
        //{2}:Time
        //{3}:Code
        //{4}:Line No.
        protected String _DefaultDebugMessageFormat = @"<span style=""color:Gray"">{2}</span>&nbsp;&nbsp;<span style=""color:Gray"">[{0}]</span> - <span style=""color:Lightsteelblue"">{3}: </span><span style=""color:DarkKhaki"">{1}</span>";
        protected String _DefaultInfoMessageFormat = @"<span style=""color:Gray"">{2}</span>&nbsp;&nbsp;<span style=""color:Black"">[{0}]</span> - <span style=""color:Black"">{3}: {1}</span>";
        protected String _DefaultWarnMessageFormat = @"<span style=""color:Gray"">{2}</span>&nbsp;&nbsp;<span style=""color:Blue"">[{0}]</span> - <span style=""color:Blue"">{3}: {1}</span>";
        protected String _DefaultErrorMessageFormat = @"<span style=""color:Gray"">{2}</span>&nbsp;&nbsp;<span style=""color:Red"">[{0}]</span> - <span style=""color:Blue"">{3}: {1}</span>";
        protected String _DefaultFatalMessageFormat = @"<span style=""color:Gray"">{2}</span>&nbsp;&nbsp;<span style=""color:Red"">[{0}]</span> - <span style=""color:Red"">{3}: {1}</span>";
    }
}
